3.13 \(\int \frac{c+d x}{a+a \sec (e+f x)} \, dx\)

Optimal. Leaf size=67 \[ -\frac{(c+d x) \tan \left (\frac{e}{2}+\frac{f x}{2}\right )}{a f}+\frac{(c+d x)^2}{2 a d}-\frac{2 d \log \left (\cos \left (\frac{e}{2}+\frac{f x}{2}\right )\right )}{a f^2} \]

[Out]

(c + d*x)^2/(2*a*d) - (2*d*Log[Cos[e/2 + (f*x)/2]])/(a*f^2) - ((c + d*x)*Tan[e/2 + (f*x)/2])/(a*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0971501, antiderivative size = 67, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.222, Rules used = {4191, 3318, 4184, 3475} \[ -\frac{(c+d x) \tan \left (\frac{e}{2}+\frac{f x}{2}\right )}{a f}+\frac{(c+d x)^2}{2 a d}-\frac{2 d \log \left (\cos \left (\frac{e}{2}+\frac{f x}{2}\right )\right )}{a f^2} \]

Antiderivative was successfully verified.

[In]

Int[(c + d*x)/(a + a*Sec[e + f*x]),x]

[Out]

(c + d*x)^2/(2*a*d) - (2*d*Log[Cos[e/2 + (f*x)/2]])/(a*f^2) - ((c + d*x)*Tan[e/2 + (f*x)/2])/(a*f)

Rule 4191

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(n_.)*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[
(c + d*x)^m, 1/(Sin[e + f*x]^n/(b + a*Sin[e + f*x])^n), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && ILtQ[n, 0] &
& IGtQ[m, 0]

Rule 3318

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(2*a)^n, Int[(c
 + d*x)^m*Sin[(1*(e + (Pi*a)/(2*b)))/2 + (f*x)/2]^(2*n), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[a^2
- b^2, 0] && IntegerQ[n] && (GtQ[n, 0] || IGtQ[m, 0])

Rule 4184

Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> -Simp[((c + d*x)^m*Cot[e + f*x])/f, x]
+ Dist[(d*m)/f, Int[(c + d*x)^(m - 1)*Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \frac{c+d x}{a+a \sec (e+f x)} \, dx &=\int \left (\frac{c+d x}{a}-\frac{c+d x}{a+a \cos (e+f x)}\right ) \, dx\\ &=\frac{(c+d x)^2}{2 a d}-\int \frac{c+d x}{a+a \cos (e+f x)} \, dx\\ &=\frac{(c+d x)^2}{2 a d}-\frac{\int (c+d x) \csc ^2\left (\frac{e+\pi }{2}+\frac{f x}{2}\right ) \, dx}{2 a}\\ &=\frac{(c+d x)^2}{2 a d}-\frac{(c+d x) \tan \left (\frac{e}{2}+\frac{f x}{2}\right )}{a f}+\frac{d \int \tan \left (\frac{e}{2}+\frac{f x}{2}\right ) \, dx}{a f}\\ &=\frac{(c+d x)^2}{2 a d}-\frac{2 d \log \left (\cos \left (\frac{e}{2}+\frac{f x}{2}\right )\right )}{a f^2}-\frac{(c+d x) \tan \left (\frac{e}{2}+\frac{f x}{2}\right )}{a f}\\ \end{align*}

Mathematica [A]  time = 0.69405, size = 104, normalized size = 1.55 \[ \frac{\cos \left (\frac{1}{2} (e+f x)\right ) \sec (e+f x) \left (\cos \left (\frac{1}{2} (e+f x)\right ) \left (f^2 x (2 c+d x)-2 d f x \tan \left (\frac{e}{2}\right )-4 d \log \left (\cos \left (\frac{1}{2} (e+f x)\right )\right )\right )-2 f \sec \left (\frac{e}{2}\right ) (c+d x) \sin \left (\frac{f x}{2}\right )\right )}{a f^2 (\sec (e+f x)+1)} \]

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x)/(a + a*Sec[e + f*x]),x]

[Out]

(Cos[(e + f*x)/2]*Sec[e + f*x]*(-2*f*(c + d*x)*Sec[e/2]*Sin[(f*x)/2] + Cos[(e + f*x)/2]*(f^2*x*(2*c + d*x) - 4
*d*Log[Cos[(e + f*x)/2]] - 2*d*f*x*Tan[e/2])))/(a*f^2*(1 + Sec[e + f*x]))

________________________________________________________________________________________

Maple [A]  time = 0.062, size = 76, normalized size = 1.1 \begin{align*}{\frac{cx}{a}}+{\frac{d{x}^{2}}{2\,a}}-{\frac{c}{fa}\tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) }-{\frac{dx}{fa}\tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) }+{\frac{d}{a{f}^{2}}\ln \left ( 1+ \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) \right ) ^{2} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x+c)/(a+a*sec(f*x+e)),x)

[Out]

c/a*x+1/2*d/a*x^2-c/f/a*tan(1/2*f*x+1/2*e)-1/f/a*x*d*tan(1/2*f*x+1/2*e)+d/a/f^2*ln(1+tan(1/2*f*x+1/2*e)^2)

________________________________________________________________________________________

Maxima [B]  time = 1.8179, size = 369, normalized size = 5.51 \begin{align*} -\frac{2 \, d e{\left (\frac{2 \, \arctan \left (\frac{\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{a f} - \frac{\sin \left (f x + e\right )}{a f{\left (\cos \left (f x + e\right ) + 1\right )}}\right )} - 2 \, c{\left (\frac{2 \, \arctan \left (\frac{\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{a} - \frac{\sin \left (f x + e\right )}{a{\left (\cos \left (f x + e\right ) + 1\right )}}\right )} - \frac{{\left ({\left (f x + e\right )}^{2} \cos \left (f x + e\right )^{2} +{\left (f x + e\right )}^{2} \sin \left (f x + e\right )^{2} + 2 \,{\left (f x + e\right )}^{2} \cos \left (f x + e\right ) +{\left (f x + e\right )}^{2} - 2 \,{\left (\cos \left (f x + e\right )^{2} + \sin \left (f x + e\right )^{2} + 2 \, \cos \left (f x + e\right ) + 1\right )} \log \left (\cos \left (f x + e\right )^{2} + \sin \left (f x + e\right )^{2} + 2 \, \cos \left (f x + e\right ) + 1\right ) - 4 \,{\left (f x + e\right )} \sin \left (f x + e\right )\right )} d}{a f \cos \left (f x + e\right )^{2} + a f \sin \left (f x + e\right )^{2} + 2 \, a f \cos \left (f x + e\right ) + a f}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)/(a+a*sec(f*x+e)),x, algorithm="maxima")

[Out]

-1/2*(2*d*e*(2*arctan(sin(f*x + e)/(cos(f*x + e) + 1))/(a*f) - sin(f*x + e)/(a*f*(cos(f*x + e) + 1))) - 2*c*(2
*arctan(sin(f*x + e)/(cos(f*x + e) + 1))/a - sin(f*x + e)/(a*(cos(f*x + e) + 1))) - ((f*x + e)^2*cos(f*x + e)^
2 + (f*x + e)^2*sin(f*x + e)^2 + 2*(f*x + e)^2*cos(f*x + e) + (f*x + e)^2 - 2*(cos(f*x + e)^2 + sin(f*x + e)^2
 + 2*cos(f*x + e) + 1)*log(cos(f*x + e)^2 + sin(f*x + e)^2 + 2*cos(f*x + e) + 1) - 4*(f*x + e)*sin(f*x + e))*d
/(a*f*cos(f*x + e)^2 + a*f*sin(f*x + e)^2 + 2*a*f*cos(f*x + e) + a*f))/f

________________________________________________________________________________________

Fricas [A]  time = 1.69409, size = 244, normalized size = 3.64 \begin{align*} \frac{d f^{2} x^{2} + 2 \, c f^{2} x +{\left (d f^{2} x^{2} + 2 \, c f^{2} x\right )} \cos \left (f x + e\right ) - 2 \,{\left (d \cos \left (f x + e\right ) + d\right )} \log \left (\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) - 2 \,{\left (d f x + c f\right )} \sin \left (f x + e\right )}{2 \,{\left (a f^{2} \cos \left (f x + e\right ) + a f^{2}\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)/(a+a*sec(f*x+e)),x, algorithm="fricas")

[Out]

1/2*(d*f^2*x^2 + 2*c*f^2*x + (d*f^2*x^2 + 2*c*f^2*x)*cos(f*x + e) - 2*(d*cos(f*x + e) + d)*log(1/2*cos(f*x + e
) + 1/2) - 2*(d*f*x + c*f)*sin(f*x + e))/(a*f^2*cos(f*x + e) + a*f^2)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \frac{\int \frac{c}{\sec{\left (e + f x \right )} + 1}\, dx + \int \frac{d x}{\sec{\left (e + f x \right )} + 1}\, dx}{a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)/(a+a*sec(f*x+e)),x)

[Out]

(Integral(c/(sec(e + f*x) + 1), x) + Integral(d*x/(sec(e + f*x) + 1), x))/a

________________________________________________________________________________________

Giac [B]  time = 1.39236, size = 392, normalized size = 5.85 \begin{align*} \frac{d f^{2} x^{2} \tan \left (\frac{1}{2} \, f x\right ) \tan \left (\frac{1}{2} \, e\right ) + 2 \, c f^{2} x \tan \left (\frac{1}{2} \, f x\right ) \tan \left (\frac{1}{2} \, e\right ) - d f^{2} x^{2} - 2 \, c f^{2} x + 2 \, d f x \tan \left (\frac{1}{2} \, f x\right ) + 2 \, d f x \tan \left (\frac{1}{2} \, e\right ) - 2 \, d \log \left (\frac{4 \,{\left (\tan \left (\frac{1}{2} \, e\right )^{2} + 1\right )}}{\tan \left (\frac{1}{2} \, f x\right )^{4} \tan \left (\frac{1}{2} \, e\right )^{2} - 2 \, \tan \left (\frac{1}{2} \, f x\right )^{3} \tan \left (\frac{1}{2} \, e\right ) + \tan \left (\frac{1}{2} \, f x\right )^{2} \tan \left (\frac{1}{2} \, e\right )^{2} + \tan \left (\frac{1}{2} \, f x\right )^{2} - 2 \, \tan \left (\frac{1}{2} \, f x\right ) \tan \left (\frac{1}{2} \, e\right ) + 1}\right ) \tan \left (\frac{1}{2} \, f x\right ) \tan \left (\frac{1}{2} \, e\right ) + 2 \, c f \tan \left (\frac{1}{2} \, f x\right ) + 2 \, c f \tan \left (\frac{1}{2} \, e\right ) + 2 \, d \log \left (\frac{4 \,{\left (\tan \left (\frac{1}{2} \, e\right )^{2} + 1\right )}}{\tan \left (\frac{1}{2} \, f x\right )^{4} \tan \left (\frac{1}{2} \, e\right )^{2} - 2 \, \tan \left (\frac{1}{2} \, f x\right )^{3} \tan \left (\frac{1}{2} \, e\right ) + \tan \left (\frac{1}{2} \, f x\right )^{2} \tan \left (\frac{1}{2} \, e\right )^{2} + \tan \left (\frac{1}{2} \, f x\right )^{2} - 2 \, \tan \left (\frac{1}{2} \, f x\right ) \tan \left (\frac{1}{2} \, e\right ) + 1}\right )}{2 \,{\left (a f^{2} \tan \left (\frac{1}{2} \, f x\right ) \tan \left (\frac{1}{2} \, e\right ) - a f^{2}\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)/(a+a*sec(f*x+e)),x, algorithm="giac")

[Out]

1/2*(d*f^2*x^2*tan(1/2*f*x)*tan(1/2*e) + 2*c*f^2*x*tan(1/2*f*x)*tan(1/2*e) - d*f^2*x^2 - 2*c*f^2*x + 2*d*f*x*t
an(1/2*f*x) + 2*d*f*x*tan(1/2*e) - 2*d*log(4*(tan(1/2*e)^2 + 1)/(tan(1/2*f*x)^4*tan(1/2*e)^2 - 2*tan(1/2*f*x)^
3*tan(1/2*e) + tan(1/2*f*x)^2*tan(1/2*e)^2 + tan(1/2*f*x)^2 - 2*tan(1/2*f*x)*tan(1/2*e) + 1))*tan(1/2*f*x)*tan
(1/2*e) + 2*c*f*tan(1/2*f*x) + 2*c*f*tan(1/2*e) + 2*d*log(4*(tan(1/2*e)^2 + 1)/(tan(1/2*f*x)^4*tan(1/2*e)^2 -
2*tan(1/2*f*x)^3*tan(1/2*e) + tan(1/2*f*x)^2*tan(1/2*e)^2 + tan(1/2*f*x)^2 - 2*tan(1/2*f*x)*tan(1/2*e) + 1)))/
(a*f^2*tan(1/2*f*x)*tan(1/2*e) - a*f^2)